package com.hxkj.client.service;

import com.github.pagehelper.PageInfo;
import com.hxkj.domain.po.Article;
import com.hxkj.domain.po.Tags;
import com.platform.common.domain.result.ParameterDataStruct;
import com.platform.common.domain.result.ResultDataStruct;
import com.platform.common.domain.result.ResultMessageStruct;
import com.platform.common.domain.result.ResultPageStruct;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author zzx
 * @create 2018-06-06 11:58
 * @desc 文章对外接口
 **/

@FeignClient(name = "cms-article")
public interface ArticleServiceClient {
    /**
     * 查询全站文章数据
     *
     * @param parameterDataStruct 文章对象 和 分页信息
     * @return 翻页数据
     * @throws Exception
     */
    @RequestMapping(value = "/article/getalllist", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    PageInfo<Article> getAllArticleList(@RequestBody ParameterDataStruct<Article> parameterDataStruct) throws Exception;

    /**
     * 获取文章列表
     *
     * @param parameterDataStruct 文章对象 和 分页信息
     * @return 翻页数据
     * @throws Exception
     */
    @RequestMapping(value = "/article/getlist", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultPageStruct<Article> getArticleList(@RequestBody ParameterDataStruct<Article> parameterDataStruct) throws Exception;

    /**
    * @Description getArticleListByTags 根据tags获取文章列表
    **/
    @RequestMapping(value = "/article/getListByTags", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultPageStruct<Article> getArticleListByTags(@RequestBody ParameterDataStruct<Article> parameterDataStruct) throws Exception;


    /**
     * 获取一条文章信息
     *
     * @param article
     * @return 文章信息
     * @throws Exception
     */
    @RequestMapping(value = "/article/get", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Article> getArticle(@RequestBody Article article) throws Exception;

    /**
     * 发布一篇文章
     *
     * @param article 文章信息
     * @throws Exception
     */
    @RequestMapping(value = "/article/save", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Article> saveArticle(@RequestBody Article article) throws Exception;

    /**
     * 移除站点至回收站
     *
     * @param article 文章信息
     * @throws Exception
     */
    @RequestMapping(value = "/article/remove", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct removerArticle(@RequestBody Article article) throws Exception;

    /**
     * 回收站 删除文章
     *
     * @param article 文章信息
     * @throws Exception
     */
    @RequestMapping(value = "/article/delete", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct deleteArticle(@RequestBody Article article) throws Exception;

    /**
     * 修改文章
     *
     * @param article 文章信息
     * @throws Exception
     */
    @RequestMapping(value = "/article/modify", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct updateArticle(@RequestBody Article article) throws Exception;

    /**
     * 文章恢复
     *
     * @param article 文章恢复
     * @throws Exception
     */
    @RequestMapping(value = "/article/articlerecover", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct articleAudit(@RequestBody Article article) throws Exception;

    /**
     * 文章审核/文章恢复/设置文章推荐级别
     *
     * @param article 文章信息
     * @throws Exception
     */
    @RequestMapping(value = "/article/update", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct articleRecover(@RequestBody Article article) throws Exception;

    /**
     * 文章置顶
     *
     * @param article 文章信息
     * @throws Exception
     */
    @RequestMapping(value = "/article/stick", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultMessageStruct articleStick(@RequestBody Article article) throws Exception;


    /**
     * 查询 新闻推荐  热门百科 一级  二级 推荐  3篇文章
     *
     * @param article
     * @return 符合条件的Article对象List
     */
    @RequestMapping(value = "/article/getnews1", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Article>> getArticle1(@RequestBody Article article) throws Exception;

    /**
     * 查询 新闻推荐  热门百科 三级 推荐      4篇文章
     *
     * @param article
     * @return 符合条件的Article对象List
     */
    @RequestMapping(value = "/article/getnews3", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Article>> getArticle3(@RequestBody Article article) throws Exception;

    /**
     * 查询 期权行情   期权百科  首页模块  无分页
     *
     * @param article
     * @return 符合条件的Article对象List
     */
    @RequestMapping(value = "/article/getArticleMarket", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Article>> getArticleMarket(@RequestBody Article article) throws Exception;

    /**
     * 查询 热门文章  取 10 条
     *
     * @param article
     * @return 符合条件的Article对象List
     */
    @RequestMapping(value = "/article/getHotArticle", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Article>> getHotArticle(@RequestBody Article article) throws Exception;

    /**
     * 查询咨询或曝光的总条数
     *
     * @param article
     * @return
     */
    @RequestMapping(value = "/article/getrightscount", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Integer> getRightsCount(@RequestBody Article article) throws Exception;

    /**
     * 新闻推荐 三级 推荐   按页数来获取文章
     *
     * @param article
     * @return 符合条件的Article对象List
     */
    @RequestMapping(value = "/article/getnews4", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Article>> getArticle4(@RequestBody Article article) throws Exception;

    /**
     * 获取上一篇文章
     */
    @RequestMapping(value = "/article/getprearticle", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Article> getPreArticle(@RequestBody Article article) throws Exception;

    /**
     * 获取下一篇文章
     */
    @RequestMapping(value = "/article/getnextarticle", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Article> getNextArticle(@RequestBody Article article) throws Exception;


    /**
     * @return com.platform.common.domain.result.ResultDataStruct<com.hxkj.domain.po.Article>
     * @author Mr.zheng
     * @Description getArticleListByParam 根据参数获取文章列表
     * @Date 10:14 2018/7/20
     * @Param [article]
     **/
    @RequestMapping(value = "/article/getArticleListByParam", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getArticleListByParam(@RequestBody Article article) throws Exception;

    /**
     * @return java.util.List<com.hxkj.domain.po.Tags>
     * @author Mr.zheng
     * @Description getTagsListByHotArticle 根据文章获取其关联的tags标签
     * @Date 14:37 2018/7/20
     * @Param [article]
     **/
    @RequestMapping(value = "/article/getTagsListByHotArticle", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Tags> getTagsListByHotArticle(@RequestBody Article article) throws Exception;

    /**
     * @return void
     * @author Mr.zheng
     * @Description modifuArticleAsPath 修改静态资源路径
     * @Date 15:24 2018/7/24
     * @Param [article]
     **/
    @RequestMapping(value = "/article/modifyArticleAsPath", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    void modifyArticleAsPath(@RequestBody Article article) throws Exception;

    /**
     * @author chenfangzhou
     * @Description 根据参数获取期权曝光和期权咨询文章列表
     **/
    @RequestMapping(value = "/article/getrightsArticlesByParam", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getrightsArticlesByParam(@RequestBody Article article) throws Exception;


    /**
     * @return com.platform.common.domain.result.ResultDataStruct<com.hxkj.domain.po.Article>
     * @author Mr.zheng
     * @Description modifyHeat 根据文章ID和站点ID修改文章热度值
     * @Date 9:34 2018/8/9
     * @Param [article]
     **/
    @RequestMapping(value = "/article/modifyHeat", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Article> modifyHeat(@RequestBody Article article) throws Exception;


    /**
     * @Description 根据模板和站点获取绑定的文章
     * @Date 2018年8月13日11:03:49
     * @Param [article]
     **/
    @RequestMapping(value = "/article/searchArticle", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Article>> searchArticle(@RequestBody Article article) throws Exception;


    /**
     * @return com.platform.common.domain.result.ResultPageStruct<com.hxkj.domain.po.Article>
     * @author Mr.zheng
     * @Description getArticleListByTime 根据文章id字符串获取30天以内的需要生成静态资源的文章列表
     * @Date 16:31 2018/8/14
     * @Param [article]
     **/
    @RequestMapping(value = "/article/getArticleListByTime", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getArticleListByTime(@RequestBody Article article) throws Exception;

    /**
     * @return com.platform.common.domain.result.ResultDataStruct<com.hxkj.domain.po.Article>
     * @author Mr.zheng
     * @Description getArticleByTempletId 根据模板ID和站点ID去获取一条文章模拟数据
     * @Date 17:38 2018/8/16
     * @Param [article]
     **/
    @RequestMapping(value = "/article/getArticleByTempletId", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Article> getArticleByTempletId(@RequestBody Article article) throws Exception;

    /**
     * 获取最近一个月内的文章  chenfangzhou
     *
     * @param article
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/article/getArticleInMonth", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getArticleInMonth(@RequestBody Article article) throws Exception;

    /**
     * 自定义标签,获取相关推荐文章  chenfangzhou
     **/
    @RequestMapping(value = "/article/getCorrelationArticle", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getCorrelationArticle(@RequestBody Article article) throws Exception;

    /**
     * 自定义标签,获取每日最新文章  chenfangzhou
     **/
    @RequestMapping(value = "/article/getDailyArticleList", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getDailyArticleList(@RequestBody Article article) throws Exception;

    /**
     * 自定义标签,获取每月最新文章  chenfangzhou
     **/
    @RequestMapping(value = "/article/getWeeklyArticleList", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getWeeklyArticleList(@RequestBody Article article) throws Exception;

    /**
     * 用户中心首页展示所有站点中文章热度最高的十篇
     *
     * @return
     */
    @RequestMapping(value = "/article/selectArticleForUserCenter", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Article>> selectArticleForUserCenter();


    /**
     * 外汇网根据tags获取相关推荐文章
     * @param article
     * @return
     */
    @RequestMapping(value = "/article/getRecommendationArticle", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getRecommendationArticle(@RequestBody Article article);

    /**
     * 根据文章的id字符串获取文章
     * @param article
     * @return
     */
    @RequestMapping(value = "/article/getArticleByIds", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    List<Article> getArticleByIds(@RequestBody Article article);

    @RequestMapping(value = "/article/getArticleByArticleId", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Article> getArticleByArticleId(@RequestBody Long articleId) throws Exception;

}
